package ifi.card.main;

import android.app.Activity;
import android.view.KeyEvent;

public abstract class ScreenActivity extends Activity{

	protected boolean continueMusic = false;
	
	@Override
	protected void onResume() {
		if(!Audio.isPlaying(R.raw.gameframe)) {
			Audio.play(R.raw.gameframe, true);
		}
		continueMusic = false;
		
		super.onResume();
	}
	@Override
	public void onPause() {
		if(!continueMusic) {
			Audio.pause(R.raw.gameframe);
		}
		super.onPause();
	}
	
	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if(keyCode == KeyEvent.KEYCODE_BACK) {
			return false;
		}
		else
			return super.onKeyDown(keyCode, event);
	}
}
